//
//  GLLoadingView.m
//  QAQ打飞机
//
//  Created by admin on 15/8/28.
//  Copyright (c) 2015年 gl. All rights reserved.
//

#import "GLLoadingView.h"

@implementation GLLoadingView
-(instancetype)initWithFrame:(CGRect)frame
{
    self =[super initWithFrame:frame];
    if (self!=nil)
    {
        //加载视图动画
        NSMutableArray *images = [NSMutableArray arrayWithCapacity:4];
        for (NSInteger i =0; i<5; i++)
        {
            NSString *imageName =[NSString stringWithFormat:@"imageView.bundle/bg-%li.jpg",i];
            UIImage *image =[UIImage imageNamed:imageName];
            [images addObject:image];
        }
        //图像视图的序列帧动画
        UIImageView *imageView =[[UIImageView alloc]initWithImage:images[0]];
        [imageView setCenter:self.center];
        [self addSubview:imageView];
        //动画
        [imageView setAnimationImages:images];
        [imageView setAnimationDuration:4.0f];
        [imageView startAnimating];
        
    }
    return self;


}


@end
